# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.shortcuts import render
from dao import models

# Create your views here.


def get_derction(request):
	derction_queryset = models.Dirction.objects.all().values('id', 'name')

	return derction_queryset


def get_classification(request):
	classification_queryset = models.Classification.objects.all().values('id', 'name')

	return classification_queryset


def get_level(request):
	# level_list = models.Video.level_choice  # 结果为元组
	level_list = map(lambda x: {'id': x[0], 'name': x[1]}, models.Video.level_choice)  # 使用map将元组构造为字典列表

	return level_list

